package com.bond.jumber.server.websocket;

import com.bond.jumper.common.util.SequenceUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import reactor.core.publisher.Mono;

@Controller
@RequestMapping()
public class WebSocketController {


    @Value("${netty.server.websocket.port}")
    private int websocketPort;

    @Value("${netty.server.ip}")
    private String ip;

    @Value("${netty.server.websocket.path}")
    private String websocketPath;

    /**
     * 返回Html5页面
     *
     * @return
     */
    @GetMapping("/")
    public Mono<String> websocket(Model model) {
        model.addAttribute("ip", ip);
        model.addAttribute("port", websocketPort);
        model.addAttribute("websocketPath", websocketPath);
        return Mono.just("websocket");
    }

}
